package com.libmessagecenter

import android.content.Context
import android.content.Intent
import com.libbase.utils.RomUtils

class PushSDK : PushSDKInterface {
    private val pushSDKImpl: PushSDKInterface? =
        if (RomUtils.isEmui || RomUtils.isHarmonyOs) {
            HmsPushMessageService.pushSDK
        } else if (RomUtils.isMiui) {
            MiPushMessageReceiver.pushSDK
        } else if (RomUtils.isOppo) {
            OppoPushMessageService.pushSDK
        } else if (RomUtils.isVivo) {
            VivoPushMessageReceiver.pushSDK
        } else {
            null
        }


    override fun register(context: Context, appId: String?, appKey: String?) {
        pushSDKImpl?.register(context, appId, appKey)
    }

    override fun handleIntent(intent: Intent): Boolean {
        return pushSDKImpl?.handleIntent(intent) ?: false
    }
}